package com.hll.erp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hll.erp.dao.UserDao;
import com.hll.erp.entity.User;
import com.hll.erp.service.UserService;
import org.springframework.stereotype.Service;

/**
 * (User)表服务实现类
 *
 * @author makejava
 * @since 2021-07-04 15:18:01
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserService {
  @Override
  public User findUserByName(String username) {
    QueryWrapper<User> wrapper = new QueryWrapper<>();
    wrapper.eq("username", username);
    return this.getOne(wrapper);
  }

  @Override
  public Page<User> getUsers(Integer current, Integer pageSize) {
    Page<User> page = new Page<>(current, pageSize);
    page = this.page(page);
    return page;
  }
}
